

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/hh1247857703/BlogOfHH.git/img/favicon.png">
  <link rel="icon" href="/hh1247857703/BlogOfHH.git/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="HH">
  <meta name="keywords" content="">
  
    <meta name="description" content="一、根据前端定义状态码返回信息等枚举值，创建枚举类:ResponseEnum.java1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253import lombok.AllArgsConstructor;import lombok.Getter;import">
<meta property="og:type" content="article">
<meta property="og:title" content="统一结果返回.md">
<meta property="og:url" content="https://gitee.com/hh1247857703/BlogOfHH.git/2022/03/31/java/%E7%BB%9F%E4%B8%80%E7%BB%93%E6%9E%9C%E8%BF%94%E5%9B%9E/index.html">
<meta property="og:site_name" content="The Blog Of HH">
<meta property="og:description" content="一、根据前端定义状态码返回信息等枚举值，创建枚举类:ResponseEnum.java1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253import lombok.AllArgsConstructor;import lombok.Getter;import">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/hh1247857703/BlogOfHH.git/img/article/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20220331164438.png">
<meta property="article:published_time" content="2022-03-31T08:36:00.000Z">
<meta property="article:modified_time" content="2022-03-31T09:14:18.202Z">
<meta property="article:author" content="HH">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://gitee.com/hh1247857703/BlogOfHH.git/img/article/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20220331164438.png">
  
  
  <title>统一结果返回.md - The Blog Of HH</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css" />
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hint.css@2/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10/styles/arta.min.css" />
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css" />
  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/hh1247857703/BlogOfHH.git/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"gitee.com","root":"/hh1247857703/BlogOfHH.git/","version":"1.8.14","typing":{"enable":true,"typeSpeed":130,"cursorChar":"💨","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":"❡"},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":true,"baidu":17795511,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/hh1247857703/BlogOfHH.git/local-search.xml"};
  </script>
  <script  src="/hh1247857703/BlogOfHH.git/js/utils.js" ></script>
  <script  src="/hh1247857703/BlogOfHH.git/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 6.1.0"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/hh1247857703/BlogOfHH.git/">
      <strong>Smile Everyday!</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/hh1247857703/BlogOfHH.git/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/hh1247857703/BlogOfHH.git/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/hh1247857703/BlogOfHH.git/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/hh1247857703/BlogOfHH.git/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/hh1247857703/BlogOfHH.git/links/">
                <i class="iconfont icon-link-fill"></i>
                友链
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/hh1247857703/BlogOfHH.git/img/article/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20220331164438.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="统一结果返回.md">
              
            </span>

            
              <div class="mt-3">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-author" aria-hidden="true"></i>
      HH
    </span>
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2022-03-31 16:36" pubdate>
        2022年3月31日 下午
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      2.8k 字
    </span>
  

  
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      24 分钟
    </span>
  

  
  
    
      <!-- 不蒜子统计文章PV -->
      <span id="busuanzi_container_page_pv" style="display: none">
        <i class="iconfont icon-eye" aria-hidden="true"></i>
        <span id="busuanzi_value_page_pv"></span> 次
      </span>
    
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">统一结果返回.md</h1>
            
              <p class="note note-info">
                
                  本文最后更新于：2 天前
                
              </p>
            
            <div class="markdown-body">
              <h2 id="一、根据前端定义状态码返回信息等枚举值，创建枚举类-ResponseEnum-java"><a href="#一、根据前端定义状态码返回信息等枚举值，创建枚举类-ResponseEnum-java" class="headerlink" title="一、根据前端定义状态码返回信息等枚举值，创建枚举类:ResponseEnum.java"></a>一、根据前端定义状态码返回信息等枚举值，创建枚举类:ResponseEnum.java</h2><figure class="highlight java"><table><tr><td class="gutter"><div class="code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br></pre></div></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">import</span> lombok.AllArgsConstructor;<br><span class="hljs-keyword">import</span> lombok.Getter;<br><span class="hljs-keyword">import</span> lombok.ToString;<br><br><span class="hljs-meta">@Getter</span><br><span class="hljs-meta">@AllArgsConstructor</span><br><span class="hljs-meta">@ToString</span><br><span class="hljs-keyword">public</span> <span class="hljs-keyword">enum</span> <span class="hljs-title class_">ResponseEnum</span> &#123;<br>    SUCCESS(<span class="hljs-number">0</span>, <span class="hljs-string">&quot;成功!&quot;</span>),<br>    ERROR(-<span class="hljs-number">1</span>, <span class="hljs-string">&quot;失败!&quot;</span>),<br><br>    <span class="hljs-comment">//-1xx 服务器错误</span><br>    BAD_SQL_GRAMMAR_ERROR(-<span class="hljs-number">101</span>, <span class="hljs-string">&quot;sql语法错误&quot;</span>),<br>    SERVLET_ERROR(-<span class="hljs-number">102</span>, <span class="hljs-string">&quot;servlet请求异常&quot;</span>),<br>    UPLOAD_ERROR(-<span class="hljs-number">103</span>, <span class="hljs-string">&quot;文件上传错误&quot;</span>),<br>    EXPORT_DATA_ERROR(<span class="hljs-number">104</span>, <span class="hljs-string">&quot;数据导出失败&quot;</span>),<br><br><br>    <span class="hljs-comment">//-2xx 参数校验</span><br>    BORROW_AMOUNT_NULL_ERROR(-<span class="hljs-number">201</span>, <span class="hljs-string">&quot;借款额度不能为空&quot;</span>),<br>    MOBILE_NULL_ERROR(-<span class="hljs-number">202</span>, <span class="hljs-string">&quot;手机号码不能为空&quot;</span>),<br>    MOBILE_ERROR(-<span class="hljs-number">203</span>, <span class="hljs-string">&quot;手机号码不正确&quot;</span>),<br>    PASSWORD_NULL_ERROR(<span class="hljs-number">204</span>, <span class="hljs-string">&quot;密码不能为空&quot;</span>),<br>    CODE_NULL_ERROR(<span class="hljs-number">205</span>, <span class="hljs-string">&quot;验证码不能为空&quot;</span>),<br>    CODE_ERROR(<span class="hljs-number">206</span>, <span class="hljs-string">&quot;验证码错误&quot;</span>),<br>    MOBILE_EXIST_ERROR(<span class="hljs-number">207</span>, <span class="hljs-string">&quot;手机号已被注册&quot;</span>),<br>    LOGIN_MOBILE_ERROR(<span class="hljs-number">208</span>, <span class="hljs-string">&quot;用户不存在&quot;</span>),<br>    LOGIN_PASSWORD_ERROR(<span class="hljs-number">209</span>, <span class="hljs-string">&quot;密码错误&quot;</span>),<br>    LOGIN_LOKED_ERROR(<span class="hljs-number">210</span>, <span class="hljs-string">&quot;用户被锁定&quot;</span>),<br>    LOGIN_AUTH_ERROR(-<span class="hljs-number">211</span>, <span class="hljs-string">&quot;未登录&quot;</span>),<br><br><br>    USER_BIND_IDCARD_EXIST_ERROR(-<span class="hljs-number">301</span>, <span class="hljs-string">&quot;身份证号码已绑定&quot;</span>),<br>    USER_NO_BIND_ERROR(<span class="hljs-number">302</span>, <span class="hljs-string">&quot;用户未绑定&quot;</span>),<br>    USER_NO_AMOUNT_ERROR(<span class="hljs-number">303</span>, <span class="hljs-string">&quot;用户信息未审核&quot;</span>),<br>    USER_AMOUNT_LESS_ERROR(<span class="hljs-number">304</span>, <span class="hljs-string">&quot;您的借款额度不足&quot;</span>),<br>    LEND_INVEST_ERROR(<span class="hljs-number">305</span>, <span class="hljs-string">&quot;当前状态无法投标&quot;</span>),<br>    LEND_FULL_SCALE_ERROR(<span class="hljs-number">306</span>, <span class="hljs-string">&quot;已满标，无法投标&quot;</span>),<br>    NOT_SUFFICIENT_FUNDS_ERROR(<span class="hljs-number">307</span>, <span class="hljs-string">&quot;余额不足，请充值&quot;</span>),<br><br>    PAY_UNIFIEDORDER_ERROR(<span class="hljs-number">401</span>, <span class="hljs-string">&quot;统一下单错误&quot;</span>),<br><br>    ALIYUN_SMS_LIMIT_CONTROL_ERROR(-<span class="hljs-number">502</span>, <span class="hljs-string">&quot;短信发送过于频繁&quot;</span>),<span class="hljs-comment">//业务限流</span><br>    ALIYUN_SMS_ERROR(-<span class="hljs-number">503</span>, <span class="hljs-string">&quot;短信发送失败&quot;</span>),<span class="hljs-comment">//其他失败</span><br><br>    WEIXIN_CALLBACK_PARAM_ERROR(-<span class="hljs-number">601</span>, <span class="hljs-string">&quot;回调参数不正确&quot;</span>),<br>    WEIXIN_FETCH_ACCESSTOKEN_ERROR(-<span class="hljs-number">602</span>, <span class="hljs-string">&quot;获取access_token失败&quot;</span>),<br>    WEIXIN_FETCH_USERINFO_ERROR(-<span class="hljs-number">603</span>, <span class="hljs-string">&quot;获取用户信息失败&quot;</span>),<br>    ;<br><br>    <span class="hljs-keyword">private</span> Integer code;   <span class="hljs-comment">// 状态码</span><br>    <span class="hljs-keyword">private</span> String message; <span class="hljs-comment">// 消息</span><br>&#125;<br></code></pre></td></tr></table></figure>

<h2 id="二、定义统一返回结果类-Result-java"><a href="#二、定义统一返回结果类-Result-java" class="headerlink" title="二、定义统一返回结果类:Result.java"></a>二、定义统一返回结果类:Result.java</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">import</span> lombok.Data;<br><span class="hljs-keyword">import</span> java.util.HashMap;<br><br><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * <span class="hljs-doctag">@author</span> Smile</span><br><span class="hljs-comment"> * <span class="hljs-doctag">@version</span> 1.0</span><br><span class="hljs-comment"> * <span class="hljs-doctag">@description</span>: 统一返回结果</span><br><span class="hljs-comment"> * <span class="hljs-doctag">@date</span> 2022/3/29 17:50</span><br><span class="hljs-comment"> */</span><br><br><span class="hljs-meta">@Data</span><br><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">Result</span> &#123;<br>    <span class="hljs-comment">// 构造私有</span><br>    <span class="hljs-keyword">private</span> <span class="hljs-title function_">Result</span><span class="hljs-params">()</span> &#123;<br>    &#125;<br><br>    <span class="hljs-keyword">private</span> Integer code;<br>    <span class="hljs-keyword">private</span> String message;<br>    <span class="hljs-keyword">private</span> HashMap&lt;String, Object&gt; data = <span class="hljs-keyword">new</span> <span class="hljs-title class_">HashMap</span>&lt;&gt;();<br><br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> Result <span class="hljs-title function_">success</span><span class="hljs-params">()</span>&#123;<br>        <span class="hljs-type">Result</span> <span class="hljs-variable">result</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">Result</span>();<br>        result.code = ResponseEnum.SUCCESS.getCode();<br>        result.message = ResponseEnum.SUCCESS.getMessage();<br>        <span class="hljs-keyword">return</span> result;<br>    &#125;<br><br>    <span class="hljs-keyword">public</span>  Result <span class="hljs-title function_">data</span><span class="hljs-params">(String key, Object value)</span> &#123;<br>        <span class="hljs-built_in">this</span>.data.put(key,value);<br>        <span class="hljs-keyword">return</span> <span class="hljs-built_in">this</span>;<br>    &#125;<br><br>    <span class="hljs-keyword">public</span> Result <span class="hljs-title function_">data</span><span class="hljs-params">(HashMap&lt;String, Object&gt; map)</span> &#123;<br>        <span class="hljs-built_in">this</span>.setData(map);<br>        <span class="hljs-keyword">return</span> <span class="hljs-built_in">this</span>;<br>    &#125;<br><br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> Result <span class="hljs-title function_">fail</span><span class="hljs-params">()</span>&#123;<br>        <span class="hljs-type">Result</span> <span class="hljs-variable">result</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">Result</span>();<br>        result.code = ResponseEnum.ERROR.getCode();<br>        result.message = ResponseEnum.ERROR.getMessage();<br>        <span class="hljs-keyword">return</span> result;<br>    &#125;<br><br>    <span class="hljs-keyword">public</span> Result <span class="hljs-title function_">message</span><span class="hljs-params">(Integer code, String message)</span> &#123;<br>        <span class="hljs-built_in">this</span>.code = code;<br>        <span class="hljs-built_in">this</span>.message = message;<br>        <span class="hljs-keyword">return</span> <span class="hljs-built_in">this</span>;<br>    &#125;<br><br>    <span class="hljs-keyword">public</span> Result <span class="hljs-title function_">message</span><span class="hljs-params">(String message)</span> &#123;<br>        <span class="hljs-built_in">this</span>.message = message;<br>        <span class="hljs-keyword">return</span> <span class="hljs-built_in">this</span>;<br>    &#125;<br>&#125;<br><br></code></pre></td></tr></table></figure>

<h2 id="三、使用"><a href="#三、使用" class="headerlink" title="三、使用"></a>三、使用</h2><p><img src="/hh1247857703/BlogOfHH.git/img/article/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20220331164337.png" srcset="/hh1247857703/BlogOfHH.git/img/loading/loading.gif" lazyload><br><img src="/hh1247857703/BlogOfHH.git/img/article/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20220331164403.png" srcset="/hh1247857703/BlogOfHH.git/img/loading/loading.gif" lazyload><br><img src="/hh1247857703/BlogOfHH.git/img/article/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20220331164438.png" srcset="/hh1247857703/BlogOfHH.git/img/loading/loading.gif" lazyload></p>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/hh1247857703/BlogOfHH.git/categories/%E7%BC%96%E7%A8%8B/">编程</a>
                    
                      <a class="hover-with-bg" href="/hh1247857703/BlogOfHH.git/categories/%E7%BC%96%E7%A8%8B/Java/">Java</a>
                    
                      <a class="hover-with-bg" href="/hh1247857703/BlogOfHH.git/categories/%E7%BC%96%E7%A8%8B/Java/Spring/">Spring</a>
                    
                  </div>
                
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/hh1247857703/BlogOfHH.git/2022/03/31/java/%E7%BB%9F%E4%B8%80%E5%BC%82%E5%B8%B8%E5%85%A8%E5%B1%80%E5%A4%84%E7%90%86/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">统一异常全局处理.md</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/hh1247857703/BlogOfHH.git/2022/03/31/java/%E4%BD%BF%E7%94%A8SpringBoot%20AOP%20%E8%AE%B0%E5%BD%95%E6%93%8D%E4%BD%9C%E6%97%A5%E5%BF%97%E3%80%81%E5%BC%82%E5%B8%B8%E6%97%A5%E5%BF%97/">
                        <span class="hidden-mobile">使用SpringBoot AOP 记录操作日志、异常日志.md</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
              <!-- Comments -->
              <article class="comments" id="comments" lazyload>
                
                  
                
                
  <div id="valine"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#valine', function() {
      Fluid.utils.createScript('https://cdn.jsdelivr.net/npm/valine@1/dist/Valine.min.js', function() {
        var options = Object.assign(
          {"appId":"YNaQpUHmK70UWg4eAuxASf1T-gzGzoHsz","appKey":"e0uHoSbv8bBD5Jruur36RDvW","path":"window.location.pathname","placeholder":null,"avatar":"robohash","meta":["nick","mail","link"],"requiredFields":[],"pageSize":10,"lang":"zh-CN","highlight":false,"recordIP":false,"serverURLs":"","emojiCDN":null,"emojiMaps":null,"enableQQ":false},
          {
            el: "#valine",
            path: window.location.pathname
          }
        )
        new Valine(options);
        Fluid.utils.waitElementVisible('#valine .vcontent', () => {
          Fluid.plugins.initFancyBox('#valine .vcontent img:not(.vemoji)');
        })
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


              </article>
            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>本网站使用Fluid主题</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  
  <div class="statistics">
    
    

    
      
        <!-- 不蒜子统计PV -->
        <span id="busuanzi_container_site_pv" style="display: none">
            总访问量 
            <span id="busuanzi_value_site_pv"></span>
             次
          </span>
      
      
        <!-- 不蒜子统计UV -->
        <span id="busuanzi_container_site_uv" style="display: none">
            总访客数 
            <span id="busuanzi_value_site_uv"></span>
             人
          </span>
      
    
  </div>


  

  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script  src="/hh1247857703/BlogOfHH.git/js/events.js" ></script>
<script  src="/hh1247857703/BlogOfHH.git/js/plugins.js" ></script>

<!-- Plugins -->


  <script  src="/hh1247857703/BlogOfHH.git/js/local-search.js" ></script>



  
    <script  src="/hh1247857703/BlogOfHH.git/js/img-lazyload.js" ></script>
  



  



  
    <script  src="https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js" ></script>
  
  
    <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js" ></script>
  



  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>




  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
        typing(title);
      
    })(window, document);
  </script>












  
    <!-- Baidu Analytics -->
    <script defer>
      var _hmt = _hmt || [];
      (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?17795511";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
  

  

  

  

  

  





<!-- 主题的启动项 保持在最底部 -->
<script  src="/hh1247857703/BlogOfHH.git/js/boot.js" ></script>


</body>
</html>
